<?php //uid recent Post 5
	$recent=uidrecent($post['uid']);
?>


<style type="text/css">
	img {max-width: 600px}
</style>

<script type="text/javascript" src="/plugins/ue/ueditor.config.js"></script>  
<script type="text/javascript" src="/plugins/ue/ueditor.all.js"></script> 

<div class="col-md-8 col-xs-12" style="margin-top:10px" >

	<div class="row" style="background-color:#FFFFFF;border-radius:3px;padding:5px;margin-bottom:10px">
		<span><a href="/index.php/Index">Home</a>/<a class="text-warning" href="/index.php/Index/board/bid/{$post['bid']}">{$post['bid']|bidname}</a></span>
	</div>

	<span id="nav_post" AM={$post['bid']}></span>

	<div class="row" style="background-color:#FFFFFF;border-radius:8px;padding:30px;margin-bottom:10px">
		<div class="row">
			<div class="col-md-1" style="margin-top:20px;">
				<img src="{$post['uid']|uidimage}" width="50px" class="img-circle">
			</div>
			<a name="top_post" id="top_post"></a>
			<div class="col-md-9" style="margin:5px;">
				<h3>{$post['title']}</h3>
				<p class="text-muted"><small>{$post['uid']|uidname} / 发布于{$post['time']|date="Y-m-d H:i",###} / 围观{$post[view]} / 回复{$post['num']} </small></p>
			</div>			
		</div>
		<hr>
		<div class="row">
			{$post['text']}

			<p class="text-right"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#fast">快速回复</button></p>
		</div>
	</div>

	<div class="row" style="background-color:#FFFFFF;border-radius:8px;padding:30px;margin-bottom:10px">
	<volist name="repost" id="re" >
		<div class="row"  >
			<div class="row" style="margin-left:10px">
				<p class="row"><b class="text-muted">第{$re['lc']}楼</b></p>
				<p class="row" AM="userinfo">
					<span class="col-md-1 col-xs-12"><a href="/index.php/Profile/index?uid={$re['uid']}"><img src="{$re["uid"]|uidimage}" width="50px" class="img-circle"></a></span>
					<span class="col-md-3 col-xs-12">
						<span class="row"><a href="/index.php/Profile/index?uid={$re['uid']}">{$re["uid"]|uidname}</a></span> 
						<i class="row"><small>#{$re['rid']} /发布于 {$re['time']|date="Y-m-d H:i",###}</small></i>
					</span>
				</p>
			</div>
			<div class="row" style="padding-left:25px;margin-top:15px">
				{$re['text']}
				<p class="text-right" style="margin:10px">
					<a href="/index.php/Index/rere?rid={$re['rid']}" class="btn btn-default btn-sm">回复</a>
				</p>
			</div>
		</div>
		<hr>
	</volist>
		<div class="row text-center">
			<p>{$page}</p>
		</div>
	</div>

	<div style="background-color:#FFFFFF;border-radius:8px;padding:30px;margin:-15px;margin-top:15px">
	<form action="/index.php/Index/repost" method="post">
		<INPUT type="text" name="pid" value="{$post['pid']}" class="hide">
		<div class="row">
			<div AM="userinfo">
				<p><a href="/index.php/Profile/index?uid={$Think.session.uid}"><img src="{$Think.session.uid|uidimage}" width="50px" class="img-circle"> {$Think.session.uid|uidname}</a></p>
			</div>
		</div>
		<div class="row">
			<textarea name="text" id="ix">
			</textarea>
			<button class="btn btn-primary">回复</button>
		</div>
	</form>
	</div>
</div>

<div class="col-md-3 col-xs-12" style="margin:10px">
	<div class="row" style="background-color:#FFFFFF;border-radius:8px;padding:30px;margin:10px;margin-left:5px">
		<form action="/index.php/Index/search" method="get" >
			<div class="row">
				<div class="input-group">
					<input type="text" name="title" class="form-control" placeholder="主题名称">
					<span class="input-group-btn">
						<input type="SUBMIT" class="btn btn-default" VALUE="搜索">
					</span>
				</div>
			</div>
		</form>
	</div>
	<div class="row" style="background-color:#FFFFFF;border-radius:8px;padding-top:10px;margin:10px;margin-left:5px">
		<p class="text-center"><?php sign_button(); ?></p>
	</div>
	<div  class="row" style="background-color:#FFFFFF;border-radius:8px;padding:30px;margin:10px;margin-left:5px">
		<p>
			<a href="/index.php/Profile/index?uid={$post['uid']}" class="btn btn-default">作者</a>
		</p>
		<p>
			<a href="/index.php/Profile/index?uid={$post['uid']}" ><img src="{$post['uid']|uidimage}" width="150px" class="img-circle center-block"></a>
		</p>
		<p>
			<p class="text-center">{$post['uid']|level}</p>
		</p>
		<p >
			<h4 class="text-center"><a href="/index.php/Profile/index?uid={$post['uid']}">{$post['uid']|uidname}</a></h4>
		</p>	
		<hr>
		<p class="text-center">
			<h5 class="text-muted">最新发布的主题:</h5>
			<ul>
				<volist name="recent" id="recent_post">
					<li><a href="/index.php/Index/post/pid/{$recent_post['pid']}">{$recent_post['title']}</a></li>

				</volist>
			</ul>
		</p>

	</div>

	<div class="row" style="background-color:#FFFFFF;border-radius:8px;padding:30px;margin:10px;margin-left:5px">
		<?php
			footer();
		?>
	</div>
</div>
<script type="text/javascript">
	var n_id=$("#nav_post").attr("AM");
	$("#n_"+n_id).addClass("active");
</script>
<script type="text/javascript">
	UE.getEditor('ix' ,{
    	toolbars: [
    		[
    			'source', //源代码
    			'undo', //撤销
        		'redo', //重做
        		'bold', //加粗
        		'italic', //斜体
        		'underline', //下划线
        		'strikethrough', //删除线
        		'fontfamily', //字体
        		'forecolor', //字体颜色
        		'fontsize', //字号
        		'link', //超链接
        		'unlink', //取消链接
           	    'emotion', //表情
        	    'backcolor', //背景色
        		'insertimage', //多图上传
        		'attachment', //附件
        		'removeformat', //清除格式
        		'horizontal', //分隔线
        		'inserttable', //插入表格
        		'fullscreen', //全屏
    		]
		]
    }
    )
</script>

<div class="modal fade " tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" id="fast">
  <div class="modal-dialog">
    <div class="modal-content">
     <div class="modal-body">
     	<form action="/index.php/Index/repost" method="post">
     		<INPUT type="text" name="pid" value="{$post['pid']}" class="hide">
     		<textarea class="form-control" name="text" style="height:183px">
     		</textarea>
     		<span style="margin:5px">
     			<button class="btn btn-default" data-dismiss="modal" style="margin:5px">取消</button>
     			<input type="submit" class="btn btn-primary" value="回复" style="margin:5px">
     		</span>
     	</form>
     </div>
    </div>
  </div>
</div>


<div class="btn-group" style="position:fixed;right:20%;bottom:5%">
	<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#fast"><span class="glyphicon glyphicon-pencil"></span> 快速回复</button>
	<a id="top_click" style="display:none" class="btn btn-default" href="#top_post" target="_self"><span class="glyphicon glyphicon-arrow-up"></span> 返回顶部</a>
</div>



<script type="text/javascript">

	var client=$(window).height();//
	var doc=$(document).height();//
	$(document).scroll(function(){
		if (doc>2*client) {
			show_top();
		};
	})

		function show_top(){		
			var now_top=$(document).scrollTop();
			if(now_top>1.5*client){
				$("#top_click").css("display","inline");
			}else{
				$("#top_click").css("display","none");
			}
		}



</script>